package com.juyu.miliao.api.domain;

import java.time.LocalDateTime;

import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.Range;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.juyu.miliao.api.validator.ChatSpendCheck;
import com.juyu.miliao.api.validator.ChatSpendEndCheck;

/**
 * 聊天费用
 * 
 * @author wbf
 */
public class ChatSpend {
	/** 聊天费用id */
	private int chatId;
	/** 拨打电话用户id */
	@Min(value = 1, groups = { ChatSpendCheck.class ,ChatSpendEndCheck.class})
	private int callUserId;
	/** 接电话用户id */
	@Min(value = 1, groups = { ChatSpendCheck.class ,ChatSpendEndCheck.class})
	private int answerUserId;
	/** 费用（单位：金币/个） */
	private int spend;
	/** 赚取钻石数(单位：个) */
	private double diamond;
	/** 聊天类型：1 语音 2视频 */
	@Range(min=1, max=2, groups = { ChatSpendCheck.class ,ChatSpendEndCheck.class})
	private int recordType;
	/** 创建时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private LocalDateTime createTime;
	/** 通话时长*/
	@Min(value = 1, groups = { ChatSpendEndCheck.class})
	private long callTime;
	private String talkTime;
	/** 通话房间号*/
	private String roomId;
	/** 当前通话计费次数*/
	private int callNum;


	public int getCallNum() {
		return callNum;
	}

	public void setCallNum(int callNum) {
		this.callNum = callNum;
	}

	public String getRoomId() {
		return roomId;
	}

	public void setRoomId(String roomId) {
		this.roomId = roomId;
	}

	public long getCallTime() {
		return callTime;
	}

	public void setCallTime(long callTime) {
		this.callTime = callTime;
	}

	public String getTalkTime() {
		return talkTime;
	}

	public void setTalkTime(String talkTime) {
		this.talkTime = talkTime;
	}

	public int getChatId() {
		return chatId;
	}

	public void setChatId(int chatId) {
		this.chatId = chatId;
	}

	public int getCallUserId() {
		return callUserId;
	}

	public void setCallUserId(int callUserId) {
		this.callUserId = callUserId;
	}

	public int getAnswerUserId() {
		return answerUserId;
	}

	public void setAnswerUserId(int answerUserId) {
		this.answerUserId = answerUserId;
	}

	public int getSpend() {
		return spend;
	}

	public void setSpend(int spend) {
		this.spend = spend;
	}

	public double getDiamond() {
		return diamond;
	}

	public void setDiamond(double diamond) {
		this.diamond = diamond;
	}

	public int getRecordType() {
		return recordType;
	}

	public void setRecordType(int recordType) {
		this.recordType = recordType;
	}

	public LocalDateTime getCreateTime() {
		return createTime;
	}

	public void setCreateTime(LocalDateTime createTime) {
		this.createTime = createTime;
	}

	@Override
	public String toString() {
		return "ChatSpend{" +
				"chatId=" + chatId +
				", callUserId=" + callUserId +
				", answerUserId=" + answerUserId +
				", spend=" + spend +
				", diamond=" + diamond +
				", recordType=" + recordType +
				", createTime=" + createTime +
				", callTime=" + callTime +
				", talkTime='" + talkTime + '\'' +
				", roomId='" + roomId + '\'' +
				", callNum=" + callNum +
				'}';
	}
}
